﻿using Microsoft.JSInterop;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("DomSharp.Test")]

namespace DomSharp
{
    public class Document
    {
        public static IJSRuntime JSRuntime { get; internal set; }

        public HtmlElement GetElementById(string id)
        {
            var methodInfo = (MethodInfo)MethodBase.GetCurrentMethod();
            var expression = Expression.Call(Expression.Constant(this), methodInfo, Expression.Constant(id));
            return new HtmlElement(expression);
        }
    }
}